home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
ptv1n4.arc
/
TSR101.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-09-13
|
812b
|
25 lines
OLD_INT_16 DD 0 ; TSR install stores old INT 16H vector here.
...
...
...
NEW_INT_16: ; TSR install points INT 16H vector to here.
STI
CMP AH,00H ; Request = 00H (get keystroke)?
JE CALL_BIOS ; ..yes, then CALL BIOS
; (and then back to us)
JMP CS:OLD_INT_16 ; ..no, just JMP to BIOS
; (it'll IRET to user)
CALL_BIOS:
PUSHF ; Simulate INT so BIOS's IRET returns to us
CALL CS:OLD_INT_16 ; call BIOS INT 16H handler
; now we're back...
PUSHF ; Save any flags from the BIOS routine
CMP AX,CS:HOT_KEY ; Is it our hot key?
JE TSR_MAINLINE ; ..yes, go do the TSR's thing
POPF ; ..no, go back to user...
IRET
...
...